{extend name="base" /}
{block name="body"}
{include file="common/header" /}
<div class="layui-hide-xs">
<div class="fly-panel fly-column">
  <div class="layui-container">
    <ul class="layui-clear">
      <li class="layui-hide-xs layui-this"><a href="/">首页</a></li> 
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li> 
      
      <!-- 用户登入后显示 -->
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/">我发表的贴</a></li> 
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/">我收藏的贴</a></li> 
    </ul> 
    <div class="fly-column-right layui-hide-xs">
   <?php if(empty(ishone())): ?><span id="layers" class="fly-search"><i class="layui-icon"></i></span> <?php endif; ?>
      <a href="/article/add" class="layui-btn">投稿请用app</a> 
    </div> 
  </div>
</div>
</div>

  <div class="layui-container">
  <div class="layui-row layui-col-space15">
       <div class="layui-col-xs12 layui-col-md8">
      <div class="fly-panel">
 
    <div class="login-wrappers" id="search_json" type="page" times="2" showtime="0" contype="string" style="display: none;">
  
    <form action="/article/search_json">
      <input autocomplete="off" placeholder="搜索内容，回车跳转" name="search" type="text"></form>
    </div>
        <ul class="fly-list">
<div id="page1-content"> 
         {volist name="article" id="vo" empty="<div class='detail-abouts'><i class='iconfont icon-zan' title='暂时没有数据'></i>&nbsp;&nbsp;<strong>暂时没有数据，本文来自互联网或网友投稿，如有侵权或违规请联系管理员删除！</strong></div>"}
                  <li>
              <a href="{:url('detail/index?Art=' . base64_encode($vo['id']) . '')}" class="fly-avatar">
              <img src="{$vo.image}" alt="{$vo.title}" />
            </a>
            <h2>
              <a href="{:url('detail/index?Art=' . base64_encode($vo['id']) . '')}">{$vo.title}</a>
            </h2>
            <div class="fly-list-info">
            <cite>{$vo.flag|raw}</cite>
             <span class="info">{$vo.weigh|raw}&nbsp;&nbsp;发表时间：<?php echo time_trans($vo['create_time']);?>&nbsp;&nbsp;点赞：{$vo.click}&nbsp;&nbsp;评论：{$vo['count']|default='110'}&nbsp;&nbsp;浏览：{$vo.view}</span>    
            </div>
          </li> 
          {/volist}
          </div>  
          <!-- 分页 --> <div style="text-align: center" id="demo-laypage-data"></div> <!-- 分页 -->

        </ul>
        <!-- 移 动 端 便 捷 操 作 -->
       <div class="icon">
         <?php if(!empty(ishone())): ?><span id="layers"><span class="pear-collapsed-pe collapse"><i class="layui-icon"></i></span></span> <?php endif; ?>
    </div>
      </div>
      </div>

   <div class="layui-col-xs12 layui-col-md4">
      <dl class="fly-panel fly-list-one">
        <dt class="fly-panel-title"><h2>本周随机推荐阅读</h2></dt>
        {volist name="model['data']" id="vo" empty="<div class='detail-abouts'><i class='iconfont icon-zan' title='暂时没有数据'></i>&nbsp;&nbsp;<strong>暂时没有数据，本文来自互联网或网友投稿，如有侵权或违规请联系管理员删除！</strong></div>"}
                <dd>
          <a href="{:url('detail/index?Art=' . base64_encode($vo['id']) . '')}">{$vo.title}</a>
          <span class="right"><i class="iconfont" title="人气"></i>{$vo.view}</span>
        </dd>
         {/volist}
                <!-- 无数据时 -->
        <!--
        <div class="fly-none">没有相关数据</div>
        -->
      </dl>

   
      <div class="fly-panel">
        <div class="fly-panel-title">
          广告位出租
        </div>
        <div class="fly-panel-main">
          <a href="https://ztuc.cn/" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #5FB878;">WY线报第一分享网云梦社区</a>
        </div>
      </div>
      
      <div class="fly-panel fly-link">
        <h3 class="fly-panel-title">友情链接</h3>
        <dl class="fly-panel-main">
                  <dd><a href="http://wap.ztuc.cn/" target="_blank">折腾社区</a></dd>
                  <dd></dd>
                  <dd><a href="http://ztuc.cn/" target="_blank">云梦社区</a></dd>
                  <dd></dd>
                   <dd><a href="http://nokc.cn/" target="_blank">两性之家</a></dd>
                  <dd></dd>
                  <dd><a href="mailto:8142355@qq.com?subject=%E7%94%B3%E8%AF%B7Fly%E7%A4%BE%E5%8C%BA%E5%8F%8B%E9%93%BE" class="fly-link">申请友链</a></dd>
                  <dd></dd>
              </dl>
      </div>
 
      </div>
      </div>
      </div> 
   {/block}      

{block name="js"}
  
<script>

        layui.use(function () {
        var laypage = layui.laypage

        //完整功能
        laypage.render({
            elem: 'demo-laypage-data'
            ,count: {$page} //数据总数，从服务端得到
            ,theme: '#FF5722' //支持传入 laypage  //数据总数，从服务端得到
            ,layout: ['prev', 'page', 'next', 'limit', 'limits', 'count', 'skip'] //自定义分页布局
            ,curr: {$current_page??0} //设定初始页
            ,groups: 5 //只显示 1 个连续页码
            ,first: '<em>首页</em>' //不显示首页
            ,last: '<em>尾页</em>' //不显示尾页
            ,prev: '<em>上一页</em>'
            ,next: '<em>下一页</em>'
            ,limit:{$current_limit??12}
            ,limits:['12','30','50','100','200','300']
            ,skipText: ['Go to', '', '确定']
            , jump: function (obj, first) {
                //obj包含了当前分页的所有参数，比如：
                //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                //console.log(obj.limit); //得到每页显示的条数
                //首次不执行
                if (!first) { 
                    var dataUrl = "/column/index.xml?ZcT={:base64_encode($current_id)}";
                    dataUrl += '&page=' + obj.curr;
                    dataUrl += '&limit=' + obj.limit;
                    //location.href = dataUrl;
                    $.get(dataUrl,function(data,status){

                      $(`#page1-content`).html($(data).find(`#page1-content`));
                    
                      });
                }

            }
        });
    });
</script>

<script type="text/javascript">
   $("#layers").click(function(){ 
  layer.open({
        type: 1,
        shadeClose: true, // 点击遮罩区域，关闭弹层
        anim: 1, // 0-6 的动画形式，-1 不开启
        title: false, //不显示标题栏
        closeBtn: false,
        area: '300px;',
        shade: 0.8,
        id: 'LAY_layuipro', //设定一个id，防止重复弹出
        content: $('#search_json'),
        end: function (){
       $('#search_json').hide();
          }
       })
    });  
   </script>
{include file="common/footer" /}
   {/block}  
